<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link type="text/css" rel="stylesheet" href="../css/app.css"/>
    <link type="text/css" rel="stylesheet" href="../css/loginMobile.css"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../datepicker/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
    <style>
        .table { margin:20px auto;width:90%;text-align:center; }
        .table td { padding:10px 0;width:50%;border:1px solid #f0f0f0; }
        .table td input { padding:5px;width:50px;border:1px solid #f0f0f0; }
    </style>
</head>
<body id="Ibody">
<!--
	制作：陈道祥
	页面：工厂原料面料
	更新：九哥
-->





<!-----------工厂原料面料面---------->
<div class="stepTwo" id="IstepEightFactoryOutput">
    <div class="companyHeadPanel">
        <div class="companyHeadOne">您工厂的原料面料</div>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="blankSpace"></div>
    <div class="blankSpace"></div>
    <p style="text-align:center;"><b>成本 * 倍数 = 加工费</b></p>
    <span id="tablelist"></span>
    <div class="blankSpace"></div>
    <div class="blankSpace"></div>
    <div class="companyInfoSpace"></div>
    <div class="companyRemark">备注：方便你的客户找到你、招聘的员工找到你、了解你、信任你，图片尽量上传完善。让客户多了解自己，容易接单成功。细节决定成败，图片清晰。</div>
    <div class="nextStepDiv">
        <span class="prevStep" onclick="history.go(-1)">返回</span>
        <span class="nextStep" onclick="setSave()">保存</span>
    </div>
</div>
<span id="standardSpan"></span>
<!-----------工厂原料面料---------->





<!-----------提示信息---------->
<div id="errMsg"></div>
<!-----------提示信息---------->
</body>
<script type="text/javascript" src="../js/loginFac.js"></script>
<script>
    (function(){
        getFacFabricList(); //加工费清单
    })();
    /**
     * 设置保存
     * */
    function setSave(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo==null || userInfo.token=='undefined') {
            getErrMsg('没有登录！',''); return;
        }
        var costNum = $('#costNum').val();
        var i, costId, costArr = new Array();
        for (i=0;i<costNum-1;i++) {
            costId = $('#costNum_'+i).val();
            costArr[i] = {
                id:costId,
                name:$('#costName_'+costId).val(),
                cost:$('#cost_'+costId).val()
            };
        }
        var data = {
            app_access:app_access,
            token:userInfo.token,
            type:userInfo.type,
            cate:userInfo.cate,
            costs:costArr
        };
        $.ajax({
            type:'post',
            url:getDomain() + 'fac-fabric-set',
            data:data,
            success:function(res){
                if (res.code!=0) {
                    console.log(res); return;
                }
                var facFabric = ''
                if (data.costs.length > 0) {
                    facFabric = true
                } else {
                    facFabric = false
                }
                
                cacheSet('facFabric', facFabric);
                //console.log(res.data); return;
                window.location.href = '/h5/login/facList.html';
            },
            error:function(){
                console.log('操作失败！'); return;
            }
        });
    }
</script>
</html>